<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://xmlns.jcp.org/jsf/passthrough"
      xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" />
        <link href="resources//css/datatable_row_links.css" rel="stylesheet" />
        <script src="../../assets/js/ie-emulation-modes-warning.js"></script>
        <title><ui:insert name="title">Facelets Template</ui:insert></title>
    </h:head>

    <h:body>
        <!-- ZAHLAVI -->  
        <nav class="navbar navbar-inverse navbar-fixed-top">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand" href="#">KUCHAŘKA</a>
                </div>
                
            <!-- Menu v zahlavi -->    
            <div>      
                <h:form>
                    <ul class="nav navbar-nav">
                        <li class="#{MenuView.active_index}">
                            <h:commandLink action="#{MenuView.showIndex}" value="Hlavní strana"/>
                        </li> 
                        <li class="#{MenuView.active_recepty}">
                            <h:commandLink action="#{MenuView.showRecepty}" value="Seznam receptů"/>
                        </li> 
                    </ul>
                </h:form>
            </div>
            
            <!-- Prihlasovaci formular -->   
                <div id="navbar" class="navbar-collapse collapse">
                    <c:choose>
                        <c:when test="#{PrihlaseniView.logged}">
                            <h:form class="navbar-form navbar-right">
                                   <font style="color:white">Přihlášený: <b><h:outputText escape="false" value="#{PrihlaseniView.username}"/></b></font>
                                <h:commandButton type="submit" class="btn btn-danger" value="Odhlásit se" action="#{PrihlaseniView.unlog()}" />
                            </h:form>
                        </c:when>
                        <c:otherwise>
                            <h:form class="navbar-form navbar-right">
                                <div class="form-group">
                                    <h:inputText class="form-control" id="email" maxlength="10" value="#{PrihlaseniView.username}" p:placeholder="Přihlašovací jméno"/>
                                </div>
                                <div class="form-group">
                                    <h:inputSecret class="form-control" id="password" maxlength="10" value="#{PrihlaseniView.password}" p:placeholder="Heslo"/>
                                </div>
                                <div class="form-group">
                                    <h:commandButton id="submit" class="btn btn-success" value="Přihlásit se" action="#{PrihlaseniView.submitLogin()}"/>
                                </div>
                                <div class="form-group">
                                    <h:commandButton id="register" class="btn btn-primary" value="Registrace" action="registrace"/>
                                </div>
                            </h:form>
                        </c:otherwise>
                    </c:choose>
                </div><!--/.navbar-collapse -->
            </div>
        </nav>
        <!-- KONEC ZAHLAVI -->  
        
        

    <!-- Main jumbotron for a primary marketing message or call to action -->
    <div class="jumbotron">
        <!-- Sekce breadcrumbs -->  
        <div class="container" style="margin-top:10px">
            <table width="100%">
              <tr>
                <td align="left">
                    <h:form>
                        <ui:insert name="breadcrumbs">breadcrumbs</ui:insert> 
                    </h:form>
                </td>
                <td align="right">
                  <h:form>
                      <h:commandLink class="btn btn-xs btn-primary" onclick="history.go(-1)"><span class="glyphicon glyphicon-arrow-left"></span> Zpět</h:commandLink>
                  </h:form>
                </td>
              </tr>
            </table>
        </div>
        <!-- Sekce nadpisu a podnadpisu -->  
        <div class="container">
            <h1><ui:insert name="heading">Heading</ui:insert></h1>
            <p><ui:insert name="subheading">subheading</ui:insert></p>
        </div>
    </div>
    
  

    <!-- Sekce hlavniho obsahu -->  
    <div class="container">
        <ui:insert name="content">Content</ui:insert>
        
    <!-- ZAPATI -->  
    <hr></hr>
    
        <footer>
            <table width="100%">
                <tr>
                    <td>
                        
                    </td>
                    <td align="right">
                        &copy; MENDELU 2015
                    </td>
                </tr>
            </table>
        </footer>
    <!-- KONEC ZAPATI -->  
      
    </div> <!-- /container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
        <script src="../../dist/js/bootstrap.min.js"></script>
        <script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
    </h:body>

</html>
